new Vue({
    el:'#app',
    data: {
        userlist:[],
        hasUpdate:false,
        id:"",//将从后端得到的数据存放在data中，以便于前端显示
    },
    created(){
        let url = window.location.href;
        let info = url.split("?")[1].split("&");
        let id = info[0].split("=")[1];

        this.id = id;

        console.log(id);

        axios({
            method:'get', //post
            url: 'http://47.94.138.204:7790/example/sayhello',
            params:{
                username : "example1",  // 得到的数据以json类型存放
            },
        }).then((res)=>{
            let result = res.data
            console.log(result)
            this.userlist = result;


        })

        axios({
            method: 'get',
            url: 'http://47.94.138.204:7790/example/updateUser',
            params:{
                gid :gid,
                uid: uid,
            },
        }).then((res) => {
            let data = res.data;
            if (data == "1"){
                this.hascollect = true;
            }

            console.log(data,"hahahhahhahah")
        })
    },
    methods:{

    },


})